package mysql

import "gorm.io/gorm"

type User struct {
	gorm.Model
	Username string `gorm:"type:varchar(100)"`
	Password string `gorm:"type:varchar(100)"`
}

func (u *User) UserLogin(db *gorm.DB, username string) error {
	return db.Where("username=?", username).FirstOrCreate(u).Error
}
